home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
network
/
mail
/
mail110.lzh
/
SHOWIX.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-02-08
|
2KB
|
90 lines
//=========================================================
//
// showix.c
//
// void showix(int from_msg, int cur_msg)
//
// Show the first(next) 16 message headers from the message
// index.
//
//=========================================================
// $Id: showix.c,v 1.2 1994/02/08 23:33:54 gbj Exp user $
/*
$Log: showix.c,v $
* Revision 1.2 1994/02/08 23:33:54 gbj
* First public release.
*
* Revision 1.1 1994/02/08 03:16:14 gbj
* Initial revision
*
*/
#include "mailer.h"
#define RVSON printf("\033p")
#define RVSOFF printf("\033q")
void showix(int from_msg, int cur_msg)
{
int mno;
char buf[81];
char buf1[10];
char msender[30];
char mdate[13];
char msubject[28];
int rflag, dflag;
if (maxmsgno+1 == 1)
printf("\n\n 1 Message\n\n");
else
printf("\n\n %d Messages\n\n", maxmsgno+1);
printf(" Msg <-----------Sender----------> <---Date---> ");
printf("<---------Subject---------->\n\n");
mno=from_msg;
while (mno < from_msg+16 && mno <= maxmsgno)
{
*buf='\0';
strncpy(msender, mailix[mno].sender, 29);
msender[29]='\0';
strncpy(mdate, mailix[mno].msgdate, 12);
mdate[12]='\0';
strncpy(msubject, mailix[mno].subject, 27);
msubject[27]='\0';
rflag=mailix[mno].rflag;
dflag=mailix[mno].dflag;
if (mno == cur_msg)
strcpy(buf, ">");
else
strcpy(buf, " ");
if (rflag)
strcat(buf, "Y");
else
strcat(buf, " ");
if (dflag)
strcat(buf, "D");
else
strcat(buf, " ");
strcat(buf, " ");
sprintf(buf1, "%03d", mno);
strcat(buf, buf1);
strcat(buf, " ");
strcat(buf, msender);
strcat(buf, " ");
strcat(buf, mdate);
strcat(buf, " ");
strcat(buf, msubject);
if (*buf == '>')
RVSON;
printf("%-79.79s", buf);
if (*buf == '>')
RVSOFF;
printf("\n");
mno++;
}
printf("\n");
return;
}